// 匹配模式-----模糊匹配,,只要以pathname开头都会被匹配到
// 精确匹配:path和pathname一样的时候,才会匹配展式
import React from 'react'
import ReactDOM from 'react-dom'
import { BrowserRouter as Router, Route, Link } from 'react-router-dom'

const Home = () => <p>进入页面，你能看到我吗</p>
const Login = () => <p>我是Login组件的内容</p>

const App = () => (
    <Router>
        <div>
            <h1>默认路由</h1>
            <Link to='/login'>登陆页面</Link>

            {/* exact 表示精确匹配 */}
            <Route exact path="/" component={Home} />
            <Route path="/login" component={Login} />
        </div>
    </Router>
)

ReactDOM.render(<App />, document.getElementById('root'))